export interface Prompt {
  id: string;
  title: string;
  content: string;
  category: string;
  shortcut?: string; // 快捷短语，以 / 开头
  variables?: string[]; // 提取的变量列表
  createdAt: number;
  updatedAt: number;
}

export interface Category {
  id: string;
  name: string;
  color?: string;
  order: number;
}

export interface VariableInput {
  name: string;
  value: string;
  placeholder?: string;
}

export interface SidebarState {
  isVisible: boolean;
  activeCategory: string | null;
  searchQuery: string;
}

export interface StorageData {
  prompts: Prompt[];
  categories: Category[];
  settings: {
    shortcutKey: string;
    autoReplace: boolean;
    doubleCtrlDelay: number; // 双击 Ctrl 的时间间隔（毫秒）
  };
}

export type MessageType = 
  | 'TOGGLE_SIDEBAR'
  | 'INSERT_TEXT'
  | 'GET_ACTIVE_ELEMENT'
  | 'REPLACE_TEXT'
  | 'SHOW_VARIABLE_MODAL';

export interface Message {
  type: MessageType;
  data?: any;
}